package dw.order

import dw.customer.Customer
import dw.object.ExtensibleObject
import dw.value.Money

/**
 * A container for line items, such as ProductLineItems, CouponLineItems, GiftCertificateLineItems. 
 * This container also provides access to shipments, shipping adjustments (promotions), and payment instruments (credit cards). 
 */
class LineItemCtnr extends ExtensibleObject {

	Money			adjustedMerchandizeTotalGrossPrice,
					adjustedMerchandizeTotalNetPrice,
					adjustedMerchandizeTotalPrice,
					adjustedMerchandizeTotalTax,
					adjustedShippingTotalGrossPrice,
					adjustedShippingTotalNetPrice,
					adjustedShippingTotalPrice,
					adjustedShippingTotalTax,
					giftCertificateTotalGrossPrice,
					giftCertificateTotalNetPrice,
					giftCertificateTotalPrice,
					giftCertificateTotalTax,
					merchandizeTotalGrossPrice,
					merchandizeTotalNetPrice,
					merchandizeTotalPrice,
					merchandizeTotalTax,
					shippingTotalGrossPrice,
					shippingTotalNetPrice,
					shippingTotalPrice,
					shippingTotalTax,
					totalGrossPrice,
					totalNetPrice,
					totalTax
					
					
	Collection		allGiftCertificateLineItems,
					allLineItems,
					allProductLineItems,
					allShippingPriceAdjustments,
					bonusDiscountLineItems,
					couponLineItems,
					giftCertificateLineItems,
					giftCertificatePaymentInstruments,
					paymentInstruments,
					priceAdjustments,
					productLineItems,
					shipments,
					shippingPriceAdjustments
					
	HashMap			allProductQuantities,
					productQuantities
	
	OrderAddress	billingAddress
	
	String			currencyCode,
					customerEmail,
					customerName,
					customerNo					
	
	Customer		customer
	
	Shipment		defaultShipment
	
	Number			productQuantityTotal
	
	
    static constraints = {
		adjustedMerchandizeTotalGrossPrice(nullable: true)
		adjustedMerchandizeTotalNetPrice(nullable: true)
		adjustedMerchandizeTotalPrice(nullable: true)
		adjustedMerchandizeTotalTax(nullable: true)
		adjustedShippingTotalGrossPrice(nullable: true)
		adjustedShippingTotalNetPrice(nullable: true)
		adjustedShippingTotalPrice(nullable: true)
		adjustedShippingTotalTax(nullable: true)
		giftCertificateTotalGrossPrice(nullable: true)
		giftCertificateTotalNetPrice(nullable: true)
		giftCertificateTotalPrice(nullable: true)
		giftCertificateTotalTax(nullable: true)
		merchandizeTotalGrossPrice(nullable: true)
		merchandizeTotalNetPrice(nullable: true)
		merchandizeTotalPrice(nullable: true)
		merchandizeTotalTax(nullable: true)
		shippingTotalGrossPrice(nullable: true)
		shippingTotalNetPrice(nullable: true)
		shippingTotalPrice(nullable: true)
		shippingTotalTax(nullable: true)
		totalGrossPrice(nullable: true)
		totalNetPrice(nullable: true)
		totalTax(nullable: true)
		
		allGiftCertificateLineItems(nullable: true)
		allLineItems(nullable: true)
		allProductLineItems(nullable: true)
		allShippingPriceAdjustments(nullable: true)
		bonusDiscountLineItems(nullable: true)
		couponLineItems(nullable: true)
		giftCertificateLineItems(nullable: true)
		giftCertificatePaymentInstruments(nullable: true)
		paymentInstruments(nullable: true)
		priceAdjustments(nullable: true)
		productLineItems(nullable: true)
		shipments(nullable: true)
		shippingPriceAdjustments(nullable: true)
		
		allProductQuantities(nullable: true)
		productQuantities(nullable: true)
		
		billingAddress(nullable: true)
		
		currencyCode(nullable: true)
		customerEmail(nullable: true)
		customerName(nullable: true)
		customerNo(nullable: true)
		
		customer(nullable: false)
		
		defaultShipment(nullable: false)
		
		productQuantityTotal(nullable: true)
    }
	
	static mapping = {
		id generator: "uuid", name: "UUID", column: "UUID", unique:"true"
	}
}
